//
//  PdfMainController.m
//  PdfChange
//
//  Created by 蓝鳍互娱 on 2024/7/26.
//

#import "PdfMainController.h"
#import "PdfVipController.h"
#import "PdfMainVipView.h"
#import "PdfMainAgreementView.h"
@interface PdfMainController ()
@property (nonatomic,strong) PdfMainVipView *pdfMainVipView;
@property (nonatomic,strong) PdfMainAgreementView *pdfMainAgreementView;
@end

@implementation PdfMainController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = PdfHex(@"#F7F7F9");
    [self creatPdfSubView];
}
- (void)creatPdfSubView{
    UIButton * pdfMainBackBtn = [[UIButton alloc] init];
    [pdfMainBackBtn setBackgroundImage:PdfImageNamed(@"") forState:UIControlStateNormal];
    [pdfMainBackBtn addTarget:self action:@selector(pdfMainBack) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:pdfMainBackBtn];
    [pdfMainBackBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(PdfRatio(24)));
        make.top.equalTo(@(PdfRatio(22) + PdfTopSafeHeight));
        make.width.equalTo(@(PdfRatio(64)));
        make.height.equalTo(@(PdfRatio(64)));
    }];
    UILabel * pdfMainTitleLab = [[UILabel alloc] init];
    pdfMainTitleLab.textColor = PdfHex(@"#000000");
    pdfMainTitleLab.text = @"我的";
    pdfMainTitleLab.font = [UIFont systemFontOfSize:PdfRatio(34) weight:UIFontWeightRegular];
    [self.view addSubview:pdfMainTitleLab];
    [pdfMainTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(pdfMainBackBtn);
        make.centerX.equalTo(self);
        make.height.equalTo(@(PdfRatio(50)));
    }];
    self.pdfMainVipView = [[PdfMainVipView alloc] init];
    [self.view addSubview:self.pdfMainVipView];
    [self.pdfMainVipView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(PdfRatio(0)));
        make.right.equalTo(@(PdfRatio(0)));
        make.height.equalTo(@(PdfRatio(133) + PdfTopSafeHeight));
        make.height.equalTo(@(PdfRatio(220)));
    }];
    PdfWeakSelf
    self.pdfMainVipView.pdfMainOpenVipBlock = ^{
        PdfVipController * pdfVipCtrl = [[PdfVipController alloc] init];
        UINavigationController * pdfVipNavCtrl = [[UINavigationController alloc] initWithRootViewController:pdfVipCtrl];
        pdfVipNavCtrl.modalPresentationStyle = UIModalPresentationOverFullScreen;
        [weakSelf presentViewController:pdfVipNavCtrl animated:true completion:^{}];
//        pdfVipCtrl.ApplePayScuBlock = ^{
//            [weakSelf.pdfMainVipView pdfUpdataVip];
//        };
    };
    self.pdfMainAgreementView = [[PdfMainAgreementView alloc] init];
    [self.view addSubview:self.pdfMainAgreementView];
    [self.pdfMainAgreementView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(PdfRatio(0)));
        make.right.equalTo(@(PdfRatio(0)));
        make.top.equalTo(self.pdfMainVipView.mas_bottom).offset(PdfRatio(13));
        make.height.equalTo(@(PdfRatio(208)));
    }];
    self.pdfMainAgreementView.PdfMainUserBlock = ^{
        
    };
    self.pdfMainAgreementView.PdfMainPriBlock = ^{
        
    };
}
- (void)pdfMainBack{
    [self.navigationController popViewControllerAnimated:true];
}
@end
